package com.swak.devtools.apidoc.parse;

import java.util.List;

import com.swak.utils.Lists;

import lombok.Data;
import lombok.ToString;

@Data
@ToString
public class ApiField {
	private String name;
	private String type;
	private String desc;
	private String example;
	private List<ApiValidation> validations;
	private ApiClass apiClass;

	public ApiField addValidation(ApiValidation validation) {
		if (validations == null) {
			validations = Lists.newArrayList();
		}
		validations.add(validation);
		return this;
	}
}
